<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>书籍列表</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

</head>
<body>
    <h2>书籍表</h2>
    <a href="/book/book_add" class="btn btn-primary">添加新书籍</a>
    <table class="table table-striped table-hover ">
        {% for book in book_list %}
            <tr>
                <td>{{ book.title }}</td>
                <td>{{ book.price }}</td>
                <td>{{ book.date|date:'Y-m-d' }}</td>
                <td>{{ book.publish.title }}</td>
                <td>
                    {% for foo in book.authors.all %}
                        {{ foo }} |
                    {% endfor %}

                </td>
                <td><a href="/book/edit/{{ book.pk }}" class="btn btn-warning">编辑</a></td>
                <td><a href="/book/delete/{{ book.pk }}" class="btn btn-danger">删除</a></td>
            </tr>
        {% endfor %}
        
    </table>
</body>
</html>